﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Point2d.Graphics
{
    public class LinesEntity : Entity
    {
        public LinesEntity(GraphicsManager manager, Color color)
            : base(manager, color)
        {
        }

        public override void Draw(System.Drawing.Graphics graphics)
        {
            if (_points.Count < 2 || _points.Count % 2 != 0)
            {
                return;
            }

            for (int i = 0; i < _points.Count; i += 2)
            {
                DrawLine(graphics, _points[i], _points[i + 1]);
            }
        }
    }
}
